using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.SharePoint.Administration;
using System.ComponentModel;

namespace WMOSSExperts.Diagnostics
{
    public enum LogCategory
    {
        WMOSSExpertsCore
    }

    [CLSCompliant(false)]
    public class DiagnosticLevel : SPAutoSerializingObject, IDiagnosticsLevel, INotifyPropertyChanged
    {
        [Persisted]
        private EventSeverity _eventSeverity;
        
        [Persisted]
        private TraceSeverity _traceSecerity;

        private String _diagnosticLevelId;

        public DiagnosticLevel()
        {
            
        }

        public DiagnosticLevel(String diagnosticId)
        {
            _diagnosticLevelId = diagnosticId;
        }

        #region IDiagnosticsLevel Members


        public EventSeverity EventSeverity
        {
            get
            {
                return _eventSeverity;
            }
            set
            {
                _eventSeverity = value;
                this.OnNotifyPropertyChanged("EventSeverity");
            }
        }

        public bool Hidden
        {
            get { return false;  }
        }

        public string Id
        {
            get { return _diagnosticLevelId; }
        }

        public string Name
        {
            get { return _diagnosticLevelId; }
        }

        public TraceSeverity TraceSeverity
        {
            get{return _traceSecerity;}
            set { _traceSecerity = value; this.OnNotifyPropertyChanged("traceSeverity"); }
        }

        #endregion

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnNotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }


        #endregion
    }

}
